X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FDirectionDetector%2FDirectionDetectorPlugin.php;h=73ea99940804e800b3d304c44725483937e22edc;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=890af068073321373e4f10dde075afd608641073;hpb=7a9777df053a9007b5eaa71f5437584065b615a5;p=quix0rs-gnu-social.git diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index 890af06807..73ea999408 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -36,7 +36,7 @@ class DirectionDetectorPlugin extends Plugin { * * @param object $notice notice is going to be saved */ - public function onStartNoticeSave($notice){ + public function onStartNoticeSave(Notice $notice) { if(!preg_match('//', $notice->rendered) && self::isRTL($notice->content)) $notice->rendered = ''.$notice->rendered.''; return true; @@ -48,7 +48,7 @@ class DirectionDetectorPlugin extends Plugin { * @param string $content * @return boolean */ - public static function isRTL($content){ + public static function isRTL($content) { $content = self::getClearText($content); $words = explode(' ', $content); $rtl = 0; @@ -71,7 +71,7 @@ class DirectionDetectorPlugin extends Plugin { * @param string $str * @return boolean */ - public static function startsWithRTLCharacter($str){ + public static function startsWithRTLCharacter($str ){ if (strlen($str) < 1) { return false; } @@ -106,7 +106,7 @@ class DirectionDetectorPlugin extends Plugin { * @param string $str * @return string */ - private static function getClearText($str){ + private static function getClearText($str) { $str = preg_replace('/@[^ ]+|![^ ]+|#[^ ]+/u', '', $str); // reply, tag, group $str = preg_replace('/^RT[: ]{1}| RT | RT: |^RD[: ]{1}| RD | RD: |[♺♻:]/u', '', $str); // redent, retweet $str = preg_replace("/[ \r\t\n]+/", ' ', trim($str)); // remove spaces @@ -118,7 +118,7 @@ class DirectionDetectorPlugin extends Plugin { * * @param Action $action */ - function onEndShowScripts($action){ + function onEndShowScripts(Action $action){ if (common_logged_in()) { $action->script($this->path('jquery.DirectionDetector.js')); } @@ -244,7 +244,7 @@ class DirectionDetectorPlugin extends Plugin { /** * plugin details */ - function onPluginVersion(&$versions){ + function onPluginVersion(array &$versions){ $url = 'http://status.net/wiki/Plugin:DirectionDetector'; $versions[] = array(