src/traits/PropertyTrait.php
private function ___checkPropertyEntry(string $name): void
    {
        if (!isset(self::$___properties[$name])) {
            try {
                // get type from docs, and strict status from self $___strict or class file
                $ref = new \ReflectionProperty($this, $name);
                $refDoc = $ref->getDocComment() ?: '';
                $refFile = $ref->getDeclaringClass()->getFileName();

                $type = null;
                $strict = self::$___strict !== null ? self::$___strict : null;
                $nullable = $this->{$name} === null;

                // get type
                if (strpos($refDoc, '@var')) {
                    $type = preg_replace('~.+@(?:var)\s+(\w+).+~is', '\1', $refDoc);
                    if (isset(self::$___propertiesType[$type])) {
                        $type = self::$___propertiesType[$type];
                    }
                }

                // get strict
                if ($strict === null) {
                    foreach (new \SplFileObject($refFile) as $line) {
                        $line = trim($line);
                        // skip comments
                        if (strpbrk($line, '/*#') !== false) {
                            continue;
                        }
                        // expects right declare() notation, sorry..
                        if (strpos($line, 'declare(strict_types=1)') !== false) {
                            $strict = true;
                            break;
                        }
                    }
                }

                // add entry
                self::$___properties[$name] = ['type' => $type, 'strict' => (bool) $strict,
                    'nullable' => $nullable];
            } catch (\ReflectionException $e) {
                throw new PropertyTraitException($e->getMessage(), $e->getCode());
            }
        }
    }
private function ___checkPropertyEntry(string $name): void
    {
        if (!isset(self::$___properties[$name])) {
            try {
                // get type from docs, and strict status from self $___strict or class file
                $ref = new \ReflectionProperty($this, $name);
                $refDoc = $ref->getDocComment() ?: '';
                $refFile = $ref->getDeclaringClass()->getFileName();

                $type = null;
                $strict = self::$___strict !== null ? self::$___strict : null;
                $nullable = $this->{$name} === null;

                // get type
                if (strpos($refDoc, '@var')) {
                    $type = preg_replace('~.+@(?:var)\s+(\w+).+~is', '\1', $refDoc);
                    if (isset(self::$___propertiesType[$type])) {
                        $type = self::$___propertiesType[$type];
                    }
                }

                // get strict
                if ($strict === null) {
                    foreach (new \SplFileObject($refFile) as $line) {
                        $line = trim($line);
                        // skip comments
                        if (strpbrk($line, '/*#') !== false) {
                            continue;
                        }
                        // expects right declare() notation, sorry..
                        if (strpos($line, 'declare(strict_types=1)') !== false) {
                            $strict = true;
                            break;
                        }
                    }
                }

                // add entry
                self::$___properties[$name] = ['type' => $type, 'strict' => (bool) $strict,
                    'nullable' => $nullable];
            } catch (\ReflectionException $e) {
                throw new PropertyTraitException($e->getMessage(), $e->getCode());
            }
        }
    }
Check property entry.
@param  string $name
@return void
@throws froq\util\traits\PropertyTraitException