for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) Nate Brunette.
* Distributed under the MIT License (http://opensource.org/licenses/MIT)
*/
declare(strict_types=1);
namespace Tebru\Gson\Internal\Naming;
use Tebru\Gson\MethodNamingStrategy;
/**
* Class UpperCaseMethodNamingStrategy
*
* @author Nate Brunette <[email protected]>
final class UpperCaseMethodNamingStrategy implements MethodNamingStrategy
{
* Accepts the PHP class property name and returns an array of the names
* of acceptable getter methods
* @param string $propertyName
* @return array
public function translateToGetter(string $propertyName): array
return [
'get' . ucfirst($propertyName),
'is' . ucfirst($propertyName),
];
}
* of acceptable setter methods
public function translateToSetter(string $propertyName): array
return ['set' . ucfirst($propertyName)];