src/Field.php
private function _getTransforms(): array
    {
        if (!$this->availableTransforms) {
            return [];
        }

        $allTransforms = Craft::$app->getAssetTransforms()->getAllTransforms();
        $transformList = [];

        foreach ($allTransforms as $transform) {
            if (!is_array($this->availableTransforms) || in_array($transform->uid, $this->availableTransforms, false)) {
                $transformList[] = [
                    'handle' => Html::encode($transform->handle),
                    'name' => Html::encode($transform->name)
                ];
            }
        }

        return $transformList;
    }
private function _getTransforms(): array
    {
        if (!$this->availableTransforms) {
            return [];
        }

        $allTransforms = Craft::$app->getAssetTransforms()->getAllTransforms();
        $transformList = [];

        foreach ($allTransforms as $transform) {
            if (!is_array($this->availableTransforms) || in_array($transform->uid, $this->availableTransforms, false)) {
                $transformList[] = [
                    'handle' => Html::encode($transform->handle),
                    'name' => Html::encode($transform->name)
                ];
            }
        }

        return $transformList;
    }
private function _getTransforms ( ) : array { if ( ! $ this -> availableTransforms ) { return [ ] ; } $ allTransforms = Craft :: $ app -> getAssetTransforms ( ) -> getAllTransforms ( ) ; $ transformList = [ ] ; foreach ( $ allTransforms as $ transform ) { if ( ! is_array ( $ this -> availableTransforms ) || in_array ( $ transform -> uid , $ this -> availableTransforms , false ) ) { $ transformList [ ] = [ 'handle' => Html :: encode ( $ transform -> handle ) , 'name' => Html :: encode ( $ transform -> name ) ] ; } } return $ transformList ; }
Get available transforms.

@return array
Get available transforms .