<?php
require_once OCS_APPLICATION_PATH . '/services/Optimization/Analyzer/Abstract/Base.php';

class Ocs_Service_Optimization_Analyzer_Permalink
    extends Ocs_Service_Optimization_Analyzer_Abstract_Base
{
    public function __invoke()
    {
        return (bool) preg_match('~^'
            . preg_quote($this->_parent->prepareForUri($this->_parent->getData('keyword')), '~')
                . '(?:-\d+)?$~iu',
            $this->_parent->getData('post')->post_name);
    }
}