Can I inherit namespaces?

0

I'm using composer with autoload in the class namespaces, assuming I have the parent Model :

Model.php

<?php
namespace App\Model;

use App\Utils;
use \PDO;

class Model {}

And the child class Item : Item.php

<?php
namespace App\Model;

class Item extends Model {}

Would there be any way for me to "inherit" also the imports of the parent class namespaces ( App\Utils and \PDO )?

I'm wondering why I'd need to use multiple classes that use App\Utils and \PDO , and would like to know if there's any way you can not repeat the use statement every time.

Thank you!

    
asked by anonymous 08.09.2018 / 02:32

1 answer

1

I researched and studied the subject, and did not find a "concrete" way to inherit namespasces . Because of this, I will be using multiple namespaces on the same line:

<?php
namespasce App\Principal;

use App\Exemplo\{NamespaceUm, NamespaceDois, NamespaceTres}

...
    
12.09.2018 / 17:08