Explorar el Código

Remove errors hiding

Visman hace 3 años
padre
commit
be151ee006

+ 2 - 2
app/Core/File.php

@@ -188,7 +188,7 @@ class File
     protected function dirProc(string $dirname): bool
     {
         if (! \is_dir($dirname)) {
-            if (! @\mkdir($dirname, 0755)) {
+            if (! \mkdir($dirname, 0755)) {
                 $this->error = 'Can not create directory';
 
                 return false;
@@ -268,7 +268,7 @@ class File
             ) {
                 $this->error = 'File is larger than the allowed size';
 
-                @\unlink($path);
+                \unlink($path);
 
                 return false;
             }

+ 6 - 6
app/Core/Mail.php

@@ -156,9 +156,9 @@ class Mail
 
         if ($strict) {
             if ($ip) {
-                $mx = @\checkdnsrr($ip, 'MX'); // ???? ipv6?
+                $mx = \checkdnsrr($ip, 'MX'); // ???? ipv6?
             } else {
-                $mx = @\dns_get_record($domainASCII, \DNS_MX);
+                $mx = \dns_get_record($domainASCII, \DNS_MX);
             }
 
             if (empty($mx)) {
@@ -475,7 +475,7 @@ class Mail
     {
         // подлючение
         if (! \is_resource($this->connect)) {
-            if (false === ($connect = @\fsockopen($this->smtp['host'], $this->smtp['port'], $errno, $errstr, 5))) {
+            if (false === ($connect = \fsockopen($this->smtp['host'], $this->smtp['port'], $errno, $errstr, 5))) {
                 throw new SmtpException("Couldn't connect to smtp host \"{$this->smtp['host']}:{$this->smtp['port']}\" ({$errno}) ({$errstr}).");
             }
             \stream_set_timeout($connect, 5);
@@ -606,14 +606,14 @@ class Mail
     protected function smtpData(?string $data, ?array $code): string
     {
         if (\is_resource($this->connect) && null !== $data) {
-            if (false === @\fwrite($this->connect, $data . $this->EOL)) {
+            if (false === \fwrite($this->connect, $data . $this->EOL)) {
                 throw new SmtpException('Couldn\'t send data to mail server.');
             }
         }
 
         $this->response = '';
         while (\is_resource($this->connect) && ! \feof($this->connect)) {
-            if (false === ($get = @\fgets($this->connect, 512))) {
+            if (false === ($get = \fgets($this->connect, 512))) {
                 throw new SmtpException('Couldn\'t get mail server response codes.');
             }
 
@@ -675,7 +675,7 @@ class Mail
                 //????
             }
 
-            @\fclose($this->connect);
+            \fclose($this->connect);
         }
     }
 }

+ 4 - 4
app/Models/BBCodeList/Structure.php

@@ -397,7 +397,7 @@ class Structure extends Model
                 if (isset($attr['format'])) {
                     if (
                         ! \is_string($attr['format'])
-                        || false === @\preg_match($attr['format'], 'abcdef')
+                        || false === \preg_match($attr['format'], 'abcdef')
                     ) {
                         return ['Attribute %1$s, %2$s - regular expression error', $name, 'Format'];
                     }
@@ -406,7 +406,7 @@ class Structure extends Model
                 if (isset($attr['body_format'])) {
                     if (
                         ! \is_string($attr['body_format'])
-                        || false === @\preg_match($attr['body_format'], 'abcdef')
+                        || false === \preg_match($attr['body_format'], 'abcdef')
                     ) {
                         return ['Attribute %1$s, %2$s - regular expression error', $name, 'Body format'];
                     }
@@ -433,7 +433,7 @@ class Structure extends Model
             if (isset($this->new_attr['format'])) {
                 if (
                     ! \is_string($this->new_attr['format'])
-                    || false === @\preg_match($this->new_attr['format'], 'abcdef')
+                    || false === \preg_match($this->new_attr['format'], 'abcdef')
                 ) {
                     return ['Attribute %1$s, %2$s - regular expression error', $name, 'Format'];
                 }
@@ -442,7 +442,7 @@ class Structure extends Model
             if (isset($this->new_attr['body_format'])) {
                 if (
                     ! \is_string($this->new_attr['body_format'])
-                    || false === @\preg_match($this->new_attr['body_format'], 'abcdef')
+                    || false === \preg_match($this->new_attr['body_format'], 'abcdef')
                 ) {
                     return ['Attribute %1$s, %2$s - regular expression error', $name, 'Body format'];
                 }

+ 1 - 1
app/Models/Pages/Admin/Host.php

@@ -29,7 +29,7 @@ class Host extends Admin
             return $this->c->Message->message('Bad request', false); // ??????
         }
 
-        $host = @\gethostbyaddr($ip);
+        $host = \gethostbyaddr($ip);
 
         $this->nameTpl = 'message';
         $this->titles  = __('Info');

+ 2 - 2
app/Models/Pages/Admin/Install.php

@@ -124,7 +124,7 @@ class Install extends Admin
         }
 
         // доступность шаблона конфигурации
-        $config = @\file_get_contents($this->c->DIR_APP . '/config/main.dist.php');
+        $config = \file_get_contents($this->c->DIR_APP . '/config/main.dist.php');
 
         if (false === $config) {
             $this->fIswev = ['e', 'No access to main.dist.php'];
@@ -1359,7 +1359,7 @@ class Install extends Admin
             $this->c->DB->exec($query, $vars);
         }
 
-        $config = @\file_get_contents($this->c->DIR_APP . '/config/main.dist.php');
+        $config = \file_get_contents($this->c->DIR_APP . '/config/main.dist.php');
 
         if (false === $config) {
             throw new RuntimeException('No access to main.dist.php.');

+ 1 - 1
app/Models/Pages/Admin/Parser/Smilies.php

@@ -364,7 +364,7 @@ class Smilies extends Parser
 
             if (
                 \is_file($file)
-                && @\unlink($file)
+                && \unlink($file)
             ) {
                 $message = ['File %s deleted redirect', $args['name']];
             } else {

+ 1 - 1
app/Models/User/User.php

@@ -206,7 +206,7 @@ class User extends DataModel
             $path = $this->c->DIR_PUBLIC . "{$this->c->config->o_avatars_dir}/{$file}";
 
             if (\is_file($path)) {
-                @\unlink($path);
+                \unlink($path);
             }
 
             $this->avatar = '';