Submit
Path:
~
/
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
rest-api
/
vendor
/
jms
/
serializer
/
src
/
Naming
/
File Content:
CamelCaseNamingStrategy.php
<?php declare (strict_types=1); namespace PleskRestApi\JMS\Serializer\Naming; use PleskRestApi\JMS\Serializer\Metadata\PropertyMetadata; /** * Generic naming strategy which translates a camel-cased property name. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ final class CamelCaseNamingStrategy implements PropertyNamingStrategyInterface { /** * @var string */ private $separator; /** * @var bool */ private $lowerCase; public function __construct(string $separator = '_', bool $lowerCase = \true) { $this->separator = $separator; $this->lowerCase = $lowerCase; } public function translateName(PropertyMetadata $property) : string { $name = \preg_replace('/[A-Z]+/', $this->separator . '\\0', $property->name); if ($this->lowerCase) { return \strtolower($name); } return \ucfirst($name); } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
CamelCaseNamingStrategy.php
930 bytes
0644
IdenticalPropertyNamingStrategy.php
345 bytes
0644
PropertyNamingStrategyInterface.php
546 bytes
0644
SerializedNameAnnotationStrategy.php
828 bytes
0644
N4ST4R_ID | Naxtarrr