private function pluggedCallbacks()
    {
        $callbacks = [];
        
        foreach (self::getReflection()->getMethods() as $method) {
            $methodName = $method->getName();
            if (
                strpos($methodName, 'Callbacks') === strlen($methodName) - 9
                && strpos($method->getDeclaringClass()->getName(), 'Rails') !== 0
            ) {
                $callbacks = array_merge($callbacks, $this->$methodName());
            }
        }
        
        return $callbacks;
    }
private function pluggedCallbacks()
    {
        $callbacks = [];
        
        foreach (self::getReflection()->getMethods() as $method) {
            $methodName = $method->getName();
            if (
                strpos($methodName, 'Callbacks') === strlen($methodName) - 9
                && strpos($method->getDeclaringClass()->getName(), 'Rails') !== 0
            ) {
                $callbacks = array_merge($callbacks, $this->$methodName());
            }
        }
        
        return $callbacks;
    }
private function pluggedCallbacks ( ) { $ callbacks = [ ] ; foreach ( self :: getReflection ( ) -> getMethods ( ) as $ method ) { $ methodName = $ method -> getName ( ) ; if ( strpos ( $ methodName , 'Callbacks' ) === strlen ( $ methodName ) - 9 && strpos ( $ method -> getDeclaringClass ( ) -> getName ( ) , 'Rails' ) !== 0 ) { $ callbacks = array_merge ( $ callbacks , $ this -> $ methodName ( ) ) ; } } return $ callbacks ; }
Any method that ends with "Callbacks" can return an array of
callbacks. This is useful for traits that require to add some callbacks,
so they don't have to be manually called by the class implementing the trait.
Any method that ends with Callbacks can return an array of callbacks . This is useful for traits that require to add some callbacks so they don t have to be manually called by the class implementing the trait .