<commit_before><?php

/**
 * AspectPHP_Advice_Extractor
 *
 * @category PHP
 * @package AspectPHP_Advice
 * @author <NAME> <<EMAIL>>
 * @copyright 2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/AspectPHP
 * @since 31.03.2012
 */

/**
 * Extracts advices from aspects.
 *
 * @category PHP
 * @package AspectPHP_Advice
 * @author <NAME> <<EMAIL>>
 * @copyright 2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/AspectPHP
 * @since 31.03.2012
 */
class AspectPHP_Advice_Extractor
{
    
    /**
     * Extracts the advices from the given aspect.
     *
     * @param AspectPHP_Aspect $aspect
     * @return AspectPHP_Advice_Container A container that contains the advices grouped by type.
     * @throws AspectPHP_Reflection_Exception If advices or pointcuts are not valid.
     */
    public function getAdvicesFrom(AspectPHP_Aspect $aspect)
    {
        $advices    = new AspectPHP_Advice_Container();
        $aspectInfo = new AspectPHP_Reflection_Aspect($aspect);
        foreach ($aspectInfo->getAdvices() as $advice) {
            /* @var $advice AspectPHP_Reflection_Advice */
            foreach (AspectPHP_Advice_Type::all() as $type) {
                /* @var $type string */
                foreach ($advice->getPointcutsByType($type) as $pointcutMethod) {
                    /* @var $pointcutMethod AspectPHP_Reflection_Pointcut */
                    $pointcut = $pointcutMethod->createPointcut($aspect);
                    $advisor  = new AspectPHP_Advice_Callback($pointcut, array($aspect, $advice->getName()));
                    $advices->{$type}()->add($advisor);
                }
            }
        }
        return $advices;
    }
    
}<commit_msg>extractor uses advisor class now<commit_after><?php

/**
 * AspectPHP_Advice_Extractor
 *
 * @category PHP
 * @package AspectPHP_Advice
 * @author <NAME> <<EMAIL>>
 * @copyright 2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/AspectPHP
 * @since 31.03.2012
 */

/**
 * Extracts advices from aspects.
 *
 * @category PHP
 * @package AspectPHP_Advice
 * @author <NAME> <<EMAIL>>
 * @copyright 2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/AspectPHP
 * @since 31.03.2012
 */
class AspectPHP_Advice_Extractor
{
    
    /**
     * Extracts the advices from the given aspect.
     *
     * Advices are represented by advisor objects, a combination of
     * pointcut and advice.
     *
     * @param AspectPHP_Aspect $aspect
     * @return AspectPHP_Advisor_Container A container that contains advisors grouped by type.
     * @throws AspectPHP_Reflection_Exception If advices or pointcuts are not valid.
     */
    public function getAdvicesFrom(AspectPHP_Aspect $aspect)
    {
        $advisors   = new AspectPHP_Advisor_Container();
        $aspectInfo = new AspectPHP_Reflection_Aspect($aspect);
        foreach ($aspectInfo->getAdvices() as $advice) {
            /* @var $advice AspectPHP_Reflection_Advice */
            foreach (AspectPHP_Advice_Type::all() as $type) {
                /* @var $type string */
                foreach ($advice->getPointcutsByType($type) as $pointcutMethod) {
                    /* @var $pointcutMethod AspectPHP_Reflection_Pointcut */
                    $pointcut = $pointcutMethod->createPointcut($aspect);
                    $advisor  = new AspectPHP_Advisor_Callback($pointcut, array($aspect, $advice->getName()));
                    $advisors->{$type}()->add($advisor);
                }
            }
        }
        return $advisors;
    }
    
}
{'fraction_non_alphanumeric': 0.11865750528541226, 'fraction_numerical': 0.013742071881606765, 'mean_word_length': 2.6464354527938343, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 31, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3854348', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1149, 'n_words': 245}