public function parse(\ReflectionClass $aspect, string $targetClass = null, string $targetMethod = null)
    {
        if ($this->annotationReader->getClassAnnotation($aspect, Aop\Aspect::class) === null) {
            return false;
        }

        $advices = [
            'before' => [],
            'after' => [],
            'afterReturn' => [],
            'afterThrow' => [],
            'around' => [],
        ];

        $className = $aspect->getName();

        foreach ($aspect->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            $adviceAnnotation = $this->annotationReader->getMethodAnnotation($method, Advice::class);

            if ($adviceAnnotation === null || !$adviceAnnotation instanceof Aop\Advice) {
                continue;
            }

            $expression = $adviceAnnotation->getExpression();
            $parsed = $this->parseExpression($expression);

            if (($targetClass !== null && $parsed['targetClass'] !== $targetClass) ||
                ($targetMethod !== null && $parsed['targetMethod'] !== $targetMethod)) {
                continue;
            }

            $advices[$parsed['adviceType']][] = [$className, $method->getName()];
        }

        return $advices;
    }