for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Cerbero\FluentApi\Inflectors;
/**
* Resource inflector using the PSR-4 standard.
*
* @author Andrea Marco Sartori
*/
class Psr4ResourceInflector implements ResourceInflectorInterface
{
* The base namespace.
* @var string
protected $namespace;
* The version number.
protected $version;
* Set the base namespace.
* @param string $namespace
* @return $this
public function baseNamespace($namespace)
$this->namespace = $namespace;
return $this;
}
* Set the version number.
* @param string $version
public function version($version)
$this->version = ucfirst($version);
* Inflect the given name returning the full resource name.
* @param string $name
* @return string
public function inflect($name)
$segments = [$this->namespace, $this->version, ucfirst($name)];
return $this->namespace = implode('\\', array_filter($segments));