Add helpful error messages to 3 most common error types

최근 커뮤니티 검색에서 가장 자주 발견되는 에러 타입 3가지:
  - 문자열에 따옴표 안 씀
  - stdClass 정의 안 함
  - 배열이 아닌 것에 배열 함수 사용
This commit is contained in:
Kijin Sung 2023-08-08 01:12:12 +09:00
parent a36177d772
commit 76fdcea292
3 changed files with 9 additions and 0 deletions

View file

@ -106,6 +106,9 @@ class MessageView extends Message
{
$regexp_list = [
'/Class [\'"]Object[\'"] not found/' => 'baseobject',
'/Undefined constant [\'"][^\'"]+?[\'"]/' => 'undef_constant',
'/Attempt to assign property [\'"][^\'"]+?[\'"] on null/' => 'undef_object',
'/Argument #\d+ \(\$\w+\) must be of type (Countable\|)?array, \w+ given ?/' => 'not_array',
];
foreach ($regexp_list as $regexp => $key)