app/Tree.php
public static function findByName($tree_name): ?Tree
    {
        foreach (self::getAll() as $tree) {
            if ($tree->name === $tree_name) {
                return $tree;
            }
        }

        return null;
    }
public static function findByName($tree_name): ?Tree
    {
        foreach (self::getAll() as $tree) {
            if ($tree->name === $tree_name) {
                return $tree;
            }
        }

        return null;
    }
public static function findByName ( $ tree_name ) : ? Tree { foreach ( self :: getAll ( ) as $ tree ) { if ( $ tree -> name === $ tree_name ) { return $ tree ; } } return null ; }
Find the tree with a specific name.

@param string $tree_name

@return Tree|null
Find the tree with a specific name .