Subversion Repositories oidplus

Rev

Rev 1124 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1124 Rev 1130
Line 22... Line 22...
22
// phpcs:disable PSR1.Files.SideEffects
22
// phpcs:disable PSR1.Files.SideEffects
23
\defined('INSIDE_OIDPLUS') or die;
23
\defined('INSIDE_OIDPLUS') or die;
24
// phpcs:enable PSR1.Files.SideEffects
24
// phpcs:enable PSR1.Files.SideEffects
25
 
25
 
26
class OIDplusPhp extends OIDplusObject {
26
class OIDplusPhp extends OIDplusObject {
-
 
27
        /**
-
 
28
         * @var string
-
 
29
         */
27
        private $php;
30
        private $php;
28
 
31
 
29
        /**
32
        /**
30
         * @param $php
33
         * @param string $php
31
         */
34
         */
32
        public function __construct($php) {
35
        public function __construct(string $php) {
33
                // TODO: syntax checks
36
                // TODO: syntax checks
34
                $this->php = $php;
37
                $this->php = $php;
35
        }
38
        }
36
 
39
 
37
        /**
40
        /**
Line 210... Line 213...
210
 
213
 
211
                return self::parse(self::ns().':'.$oid_up);
214
                return self::parse(self::ns().':'.$oid_up);
212
        }
215
        }
213
 
216
 
214
        /**
217
        /**
215
         * @param $to
218
         * @param OIDplusObject|string $to
216
         * @return int|null
219
         * @return int|null
217
         */
220
         */
218
        public function distance($to) {
221
        public function distance($to) {
219
                if (!is_object($to)) $to = OIDplusObject::parse($to);
222
                if (!is_object($to)) $to = OIDplusObject::parse($to);
220
                if (!$to) return null;
223
                if (!$to) return null;
Line 238... Line 241...
238
                return count($ary) - count($bry);
241
                return count($ary) - count($bry);
239
        }
242
        }
240
 
243
 
241
        /**
244
        /**
242
         * @return string
245
         * @return string
-
 
246
         * @throws OIDplusException
243
         */
247
         */
244
        public function getDirectoryName(): string {
248
        public function getDirectoryName(): string {
245
                if ($this->isRoot()) return $this->ns();
249
                if ($this->isRoot()) return $this->ns();
246
                if (OIDplus::baseConfig()->getValue('PLUGIN_PHP_TYPE_LINK_TO_WEBFAN', false)) {
250
                if (OIDplus::baseConfig()->getValue('PLUGIN_PHP_TYPE_LINK_TO_WEBFAN', false)) {
247
                        return $this->ns().str_replace(['\\', "/"], [\DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR], $this->nodeId(false));
251
                        return $this->ns().str_replace(['\\', "/"], [\DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR], $this->nodeId(false));