src/Standards/BestIt/CodeSniffer/Helper/PropertyHelper.php
public function getProperties(array $classToken, ?File $file = null): array
    {
        if (!$file) {
            $file = $this->file;
        }

        $properties = [];
        $startPos = $classToken['scope_opener'] ?? 0;
        $tokens = $file->getTokens();

        while (($propertyPos = $file->findNext([T_VARIABLE], $startPos, $classToken['scope_closer'])) > 0) {
            if ($this->isProperty($propertyPos)) {
                $properties[] = substr($tokens[$propertyPos]['content'], 1);
            }

            $startPos = $propertyPos + 1;
        }

        return $properties;
    }
public function getProperties(array $classToken, ?File $file = null): array
    {
        if (!$file) {
            $file = $this->file;
        }

        $properties = [];
        $startPos = $classToken['scope_opener'] ?? 0;
        $tokens = $file->getTokens();

        while (($propertyPos = $file->findNext([T_VARIABLE], $startPos, $classToken['scope_closer'])) > 0) {
            if ($this->isProperty($propertyPos)) {
                $properties[] = substr($tokens[$propertyPos]['content'], 1);
            }

            $startPos = $propertyPos + 1;
        }

        return $properties;
    }
public function getProperties ( array $ classToken , ? File $ file = null ) : array { if ( ! $ file ) { $ file = $ this -> file ; } $ properties = [ ] ; $ startPos = $ classToken [ 'scope_opener' ] ?? 0 ; $ tokens = $ file -> getTokens ( ) ; while ( ( $ propertyPos = $ file -> findNext ( [ T_VARIABLE ] , $ startPos , $ classToken [ 'scope_closer' ] ) ) > 0 ) { if ( $ this -> isProperty ( $ propertyPos ) ) { $ properties [ ] = substr ( $ tokens [ $ propertyPos ] [ 'content' ] , 1 ) ; } $ startPos = $ propertyPos + 1 ; } return $ properties ; }
Returns the names of the class' properties.

@param array $classToken The token array for the class like structure.
@param File|null $file The used file. If not given then the file from the construct is used.

@return array The names of the properties.
Returns the names of the class properties .