class Company
{
  public $company;
  public function __construct($company = null)
  {
    if (preg_match("/[a-zA-Z\s]+/",$company)){
      $this->conmapy = $company;}
  }
  public function checkCompany(){
    if($this->company === null){
      echo 'Имя компании введено не коректо';
    }
  }
}
$obj = new Company($_POST['company']);
$obj->checkCompany();
class Agre
{
  public $agre;
  public function __construct($ager = null)
  {
    if (!empty($agre)){
      $this->agre = $agre;}
  }
    public function checkAgre(){
      if($this->agre === null){
        echo 'Не все поля заполены';
      }
    }
  }При вводе любых значений в инпуты класа company name выдает ошибку.