Service/GearmanParser.php
public function parseFiles(
        Finder $finder,
        Reader $reader,
        WorkerCollection $workerCollection
    )
    {

        /**
         * Every file found is parsed
         */
        foreach ($finder as $file) {

            /**
             * File is accepted to be parsed
             */
            $classNamespace = $this->getFileClassNamespace($file->getRealpath());
            $reflectionClass = new ReflectionClass($classNamespace);
            $classAnnotations = $reader->getClassAnnotations($reflectionClass);

            /**
             * Every annotation found is parsed
             */
            foreach ($classAnnotations as $annotation) {

                /**
                 * Annotation is only laoded if is typeof WorkAnnotation
                 */
                if ($annotation instanceof WorkAnnotation) {

                    /**
                     * Creates new Worker element with all its Job data
                     */
                    $worker = new Worker($annotation, $reflectionClass, $reader, $this->servers, $this->defaultSettings);
                    $workerCollection->add($worker);
                }
            }
        }

        return $this;
    }
public function parseFiles(
        Finder $finder,
        Reader $reader,
        WorkerCollection $workerCollection
    )
    {

        /**
         * Every file found is parsed
         */
        foreach ($finder as $file) {

            /**
             * File is accepted to be parsed
             */
            $classNamespace = $this->getFileClassNamespace($file->getRealpath());
            $reflectionClass = new ReflectionClass($classNamespace);
            $classAnnotations = $reader->getClassAnnotations($reflectionClass);

            /**
             * Every annotation found is parsed
             */
            foreach ($classAnnotations as $annotation) {

                /**
                 * Annotation is only laoded if is typeof WorkAnnotation
                 */
                if ($annotation instanceof WorkAnnotation) {

                    /**
                     * Creates new Worker element with all its Job data
                     */
                    $worker = new Worker($annotation, $reflectionClass, $reader, $this->servers, $this->defaultSettings);
                    $workerCollection->add($worker);
                }
            }
        }

        return $this;
    }
public function parseFiles ( Finder $ finder , Reader $ reader , WorkerCollection $ workerCollection ) { /**
         * Every file found is parsed
         */ foreach ( $ finder as $ file ) { /**
             * File is accepted to be parsed
             */ $ classNamespace = $ this -> getFileClassNamespace ( $ file -> getRealpath ( ) ) ; $ reflectionClass = new ReflectionClass ( $ classNamespace ) ; $ classAnnotations = $ reader -> getClassAnnotations ( $ reflectionClass ) ; /**
             * Every annotation found is parsed
             */ foreach ( $ classAnnotations as $ annotation ) { /**
                 * Annotation is only laoded if is typeof WorkAnnotation
                 */ if ( $ annotation instanceof WorkAnnotation ) { /**
                     * Creates new Worker element with all its Job data
                     */ $ worker = new Worker ( $ annotation , $ reflectionClass , $ reader , $ this -> servers , $ this -> defaultSettings ) ; $ workerCollection -> add ( $ worker ) ; } } } return $ this ; }
Load all workers with their jobs

@param Finder           $finder           Finder
@param Reader           $reader           Reader
@param WorkerCollection $workerCollection Worker collection

@return GearmanParser self Object
Load all workers with their jobs