for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bludata\Lumen\Providers;
use Illuminate\Support\ServiceProvider;
class RegisterCustomAnnotationsServiceProvider extends ServiceProvider
{
public function register()
/**
* Caso haja outras annotations que necessitem ser registradas, basta adicionar o path das mesmas no array $paths.
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
*/
$paths = [
__DIR__.'/../../Doctrine/Common/Annotations', //referente a Bludata\Doctrine\Common\Annotations
base_path().'/vendor/symfony/validator/Constraints', //referente a Symfony\Component\Validator\Constraints
];
foreach ($paths as $path) {
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
$pathFile = $path.'/'.$file;
if (pathinfo($pathFile)['extension'] == 'php') {
\Doctrine\Common\Annotations\AnnotationRegistry::registerFile($pathFile);
}
closedir($handle);
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.