Commit 12c653d5 authored by luhongguang's avatar luhongguang

update:composer update

parent 0e9bc727
This diff is collapsed.
...@@ -192,7 +192,7 @@ class Daemon ...@@ -192,7 +192,7 @@ class Daemon
// $to = 'api@yidian-inc.com'; // $to = 'api@yidian-inc.com';
$to = 'zhangyu1@yidian-inc.com'; $to = 'zhangyu1@yidian-inc.com';
Email::sendMail('noreply@yidian-inc.com', $to, $subject, $mail_body); Email::sendMail('bp-noreply@yidian-inc.com', $to, $subject, $mail_body);
} }
} }
} }
......
...@@ -26,7 +26,7 @@ class JwUser ...@@ -26,7 +26,7 @@ class JwUser
*/ */
public function getUserInfo($params) public function getUserInfo($params)
{ {
$url = config('interface', 'service.jw_user.get_user_info'); $url = config('interface', 'service.jw_user.get_user_info');
if (!$url) { if (!$url) {
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
...@@ -65,10 +65,10 @@ class JwUser ...@@ -65,10 +65,10 @@ class JwUser
$begin = microtime(true); $begin = microtime(true);
$user_info = (new Request())->post($url, $params); $user_info = (new Request())->post($url, $params);
$end = microtime(true); $end = microtime(true);
$total_time = round(($end - $begin),4) * 1000; $total_time = round(($end - $begin), 4) * 1000;
if(!empty($user_info['response'])){ if (!empty($user_info['response'])) {
$code = $user_info['response']['code']; $code = $user_info['response']['code'];
}else{ } else {
$code = -1; $code = -1;
} }
MonUtil::proxyMon($url, $code, 'jw_user', $total_time); MonUtil::proxyMon($url, $code, 'jw_user', $total_time);
...@@ -92,7 +92,7 @@ class JwUser ...@@ -92,7 +92,7 @@ class JwUser
$params = ["userIds" => $params['user_id']]; $params = ["userIds" => $params['user_id']];
//$user_info = (new TimeOut())->runPost($url, $params); //$user_info = (new TimeOut())->runPost($url, $params);
$user_info = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user'); $user_info = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_getUserList', json_encode($user_info)); FileLog::info('jw_user_getUserList', json_encode($user_info));
if (!$user_info) { if (!$user_info) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
...@@ -139,7 +139,7 @@ class JwUser ...@@ -139,7 +139,7 @@ class JwUser
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
} }
//$pushToken = (new TimeOut())->runPost($url, $params); //$pushToken = (new TimeOut())->runPost($url, $params);
$pushToken = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user'); $pushToken = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_savePushToken', json_encode($pushToken)); FileLog::info('jw_user_savePushToken', json_encode($pushToken));
if (!$pushToken) { if (!$pushToken) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
...@@ -164,7 +164,7 @@ class JwUser ...@@ -164,7 +164,7 @@ class JwUser
$params = ["userIds" => $params['user_id']]; $params = ["userIds" => $params['user_id']];
//$list = (new TimeOut())->runPost($url, $params); //$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user'); $list = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_getUserListWithDynamic', json_encode($list)); FileLog::info('jw_user_getUserListWithDynamic', json_encode($list));
if (!$list) { if (!$list) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
...@@ -189,7 +189,7 @@ class JwUser ...@@ -189,7 +189,7 @@ class JwUser
$params = ["userId" => $params['user_id']]; $params = ["userId" => $params['user_id']];
//$list = (new TimeOut())->runPost($url, $params); //$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user'); $list = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_getUserDigg', json_encode($list)); FileLog::info('jw_user_getUserDigg', json_encode($list));
if (!$list) { if (!$list) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
...@@ -207,11 +207,29 @@ class JwUser ...@@ -207,11 +207,29 @@ class JwUser
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
} }
//$ret = (new TimeOut())->runPost($url, $params); //$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user'); $ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_saveUpdateLife', json_encode($ret)); FileLog::info('jw_user_saveUpdateLife', json_encode($ret));
if (!$ret) { if (!$ret) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return !empty($ret['response']) ? $ret['response'] : []; return !empty($ret['response']) ? $ret['response'] : [];
} }
}
\ No newline at end of file /**
* 获取简网微信openid
*/
public static function getWechatOpenid($params)
{
$url = config('interface', 'service.jw_user.get_wechat_openid');
if (!$url) {
throw new CodeSpecialException("failed");
}
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('getWechatOpenid', json_encode($ret));
if (!$ret) {
throw new CodeSpecialException("timeout");
}
return !empty($ret['response']) ? $ret['response'] : [];
}
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Api\PhpServices\Ksy; namespace Api\PhpServices\Ksy;
use Api\PhpUtils\Http\HttpUtil; use Api\PhpUtils\Http\HttpUtil;
use Api\PhpUtils\Mon\MonUtil;
/** /**
* 文档: http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=68515904 * 文档: http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=68515904
...@@ -47,7 +48,13 @@ class Ks3Api ...@@ -47,7 +48,13 @@ class Ks3Api
"signature" => $signature, "signature" => $signature,
"type" => $type, "type" => $type,
]; ];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$genRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $genRes["response"]['code'], 'ks3api', $totalTime);
return $genRes;
} }
/** /**
...@@ -78,7 +85,13 @@ class Ks3Api ...@@ -78,7 +85,13 @@ class Ks3Api
"resource" => $resource, "resource" => $resource,
"headers" => $headers, "headers" => $headers,
]; ];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$signatureRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $signatureRes["response"]['code'], 'ks3api', $totalTime);
return $signatureRes;
} }
/** /**
...@@ -112,7 +125,13 @@ class Ks3Api ...@@ -112,7 +125,13 @@ class Ks3Api
"content_type" => $contentType, "content_type" => $contentType,
"extend" => $extendJsonStr, "extend" => $extendJsonStr,
]; ];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$encryptRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $encryptRes["response"]['code'], 'ks3api', $totalTime);
return $encryptRes;
} }
/** /**
...@@ -139,7 +158,13 @@ class Ks3Api ...@@ -139,7 +158,13 @@ class Ks3Api
"signature" => $signature, "signature" => $signature,
"extend" => $extendJsonStr, "extend" => $extendJsonStr,
]; ];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$uploadRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $uploadRes["response"]['code'], 'ks3api', $totalTime);
return $uploadRes;
} }
/** /**
......
...@@ -81,6 +81,7 @@ class Sms ...@@ -81,6 +81,7 @@ class Sms
'ticket_expire' => !empty($params['ticket_expire']) ? $params['ticket_expire'] : 86400, 'ticket_expire' => !empty($params['ticket_expire']) ? $params['ticket_expire'] : 86400,
'resend_times' => !empty($params['resend_times']) ? $params['resend_times'] : 5, 'resend_times' => !empty($params['resend_times']) ? $params['resend_times'] : 5,
'retry_times' => !empty($params['retry_times']) ? $params['retry_times'] : 10, 'retry_times' => !empty($params['retry_times']) ? $params['retry_times'] : 10,
'code_expire' => !empty($params['code_expire']) ? $params['code_expire'] : 600,
]; ];
$sms = (new TimeOut())->runGet($url, $params); $sms = (new TimeOut())->runGet($url, $params);
......
...@@ -74,36 +74,6 @@ class CacheUtil ...@@ -74,36 +74,6 @@ class CacheUtil
return call_user_func_array([$this->handler, $method], $args); return call_user_func_array([$this->handler, $method], $args);
} }
/**
* 获取原始数据
* @param $key
* @return mixed
*/
public function getUnChange($key, $prefix = ''){
return $this->handler->get($this->getCacheKey($prefix, $key));
}
/**
* 保存原始数据
* @param $key
* @param $value
* @param $expire
* @return mixed
*/
public function setUnChange($key , $value , $expire = null, $prefix = ''){
if (is_null($expire)) {
// $expire = $this->expire;
return false;
}
$key = $this->getCacheKey($prefix, $key);
if (is_int($expire) && $expire) {
$result = $this->handler->setex($key, $expire, $value);
} else {
$result = $this->handler->set($key, $value);
}
return $result;
}
/** /**
* 读取缓存 * 读取缓存
* @access public * @access public
...@@ -117,9 +87,7 @@ class CacheUtil ...@@ -117,9 +87,7 @@ class CacheUtil
if (is_null($value) || false === $value) { if (is_null($value) || false === $value) {
return $default; return $default;
} }
$jsonData = json_decode($value, true); return $value;
// 检测是否为JSON数据 true 返回JSON解析数组, false返回源数据
return (null === $jsonData) ? $value : $jsonData;
} }
/** /**
...@@ -129,24 +97,13 @@ class CacheUtil ...@@ -129,24 +97,13 @@ class CacheUtil
* @param mixed $default 默认值 * @param mixed $default 默认值
* @return mixed * @return mixed
*/ */
public function gets($keys, $prefix = '', $default = false) public function gets($keys, $prefix = '')
{ {
if(empty($keys) || !is_array($keys)) { if(empty($keys) || !is_array($keys)) {
return $default; return false;
} }
$keys = array_values($keys); $keys = array_values($keys);
$values = $this->handler->mGet($this->getCacheKey($prefix, $keys)); return $this->handler->mGet($this->getCacheKey($prefix, $keys));
if (is_null($values) || false === $values) {
return $default;
}
$result = [];
foreach((array)$values as $i => $value) {
if($value !== false) {
$jsonData = json_decode($value, true);
$result[$keys[$i]] = (null === $jsonData) ? $value : $jsonData;
}
}
return $result;
} }
/** /**
...@@ -165,7 +122,6 @@ class CacheUtil ...@@ -165,7 +122,6 @@ class CacheUtil
} }
$key = $this->getCacheKey($prefix, $key); $key = $this->getCacheKey($prefix, $key);
//对数组/对象数据进行缓存处理,保证数据完整性 //对数组/对象数据进行缓存处理,保证数据完整性
$value = (is_object($value) || is_array($value)) ? json_encode($value) : $value;
if (is_int($expire) && $expire) { if (is_int($expire) && $expire) {
$result = $this->handler->setex($key, $expire, $value); $result = $this->handler->setex($key, $expire, $value);
} else { } else {
...@@ -189,7 +145,6 @@ class CacheUtil ...@@ -189,7 +145,6 @@ class CacheUtil
$this->handler->multi(); $this->handler->multi();
foreach($items as $key => $value) { foreach($items as $key => $value) {
$key = $this->getCacheKey($prefix, $key); $key = $this->getCacheKey($prefix, $key);
$value = (is_object($value) || is_array($value)) ? json_encode($value) : $value;
$this->handler->setex($key, $expire, $value); $this->handler->setex($key, $expire, $value);
} }
return $this->handler->exec(); return $this->handler->exec();
...@@ -210,7 +165,6 @@ class CacheUtil ...@@ -210,7 +165,6 @@ class CacheUtil
} }
$key = $this->getCacheKey($prefix, $key); $key = $this->getCacheKey($prefix, $key);
//对数组/对象数据进行缓存处理,保证数据完整性 //对数组/对象数据进行缓存处理,保证数据完整性
$value = (is_object($value) || is_array($value)) ? json_encode($value) : $value;
if(is_int($expire) && $expire) { if(is_int($expire) && $expire) {
$result = $this->handler->setenx($key, $expire, $value); $result = $this->handler->setenx($key, $expire, $value);
} else { } else {
......
<?php
namespace Api\PhpUtils\Common;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
/**
* 根据给定数据生成excel文件,可选择生成本地临时文件或浏览器直接输出
*
* @author
* @since 2021-07-25
*/
class ExportExcel
{
/**
* 获取生成excel文件的绝对地址
*
* @param 必填项 :items {要生成excel的二维数组,array}
* @param 必填项 :keywords {生成excel使用的keywords数组(具体格式详见SendExportMail.class.php中keywords属性),array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return string {生成的excel文件的绝对地址}
*/
public static function getExcelFilePath($items, array $keywords, $filename = false)
{
$objPHPExcel = self::getPHPExcelObj($items, $keywords, $filename);
$writer = new Xlsx($objPHPExcel);
$filename = "/tmp/" . $filename;
if (file_exists($filename)) {
unlink($filename);
} else {
//$fp = fopen($filename, 'a');
}
//$objWriter->save($filename);
$writer->save($filename);
return $filename;
}
/**
* 生成PHPExcel object用于输出
*
* @param 必填项 :items {要生成excel的数组,array}
* @param 必填项 :keywords {生成excel文件使用的keywords数组(具体格式详见本类中keywords属性),array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return object {PHPExcel object}
*/
private static function getPHPExcelObj($items, array $keywords, $filename = false)
{
set_time_limit(0);
// Create new PHPExcel object
$objPHPExcel = new \PHPExcel();
// Set document properties
$objPHPExcel->getProperties()
->setCreator("yidian")
->setLastModifiedBy("yidian")
->setTitle("标题")
->setSubject("题目")
->setDescription("描述")
->setKeywords("关键字")
->setCategory("种类");
$ActiveSheet = $objPHPExcel->getActiveSheet();
$keywords = self::getKeywordsWithAlpha($keywords);
foreach ($keywords as $key => $value) {
// set the wdith of cloumn
$ActiveSheet->getColumnDimension($key)->setWidth($value['column_width']);
// set the value of first row
$ActiveSheet->getStyle($key)
->getAlignment()
->setHorizontal('center');
$ActiveSheet->setCellValue($key . '1', $value['column_name']);
}
$index = 2;
if (is_array($items)) {
foreach ($items as $item) {
foreach ($keywords as $key => $value) {
if (0 && is_numeric($item[$value['key']]) && ! is_int($item[$value['key']])) {
$ActiveSheet->setCellValue($key . $index, floatval($item[$value['key']]));
} elseif (0 && is_numeric($item[$value['key']])) {
$ActiveSheet->setCellValue($key . $index, intval($item[$value['key']]));
} else {
$ActiveSheet->setCellValue($key . $index, $item[$value['key']] . ' ');
}
$Alignment = $ActiveSheet->getStyle($key . $index)->getAlignment();
// 换行
$Alignment->setWrapText(true);
// 垂直居中
$Alignment->setVertical('center');
}
$index ++;
}
}
return $objPHPExcel;
}
/**
* 获取生成多sheet页excel文件的绝对地址
*
* @param 必填项 :data {要生成excel的三维数组,sheet页为第一维,array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return string {生成的excel文件的绝对地址}
*/
public static function getExcelFileForMultiSheet($data, $filename)
{
$objPHPExcel = self::getPHPExcelObjForMultiSheet($data);
$writer = new Xlsx($objPHPExcel);
//$objWriter = new \PHPExcel_Writer_Excel5($objPHPExcel);
$filename = "/tmp/" . $filename;
//$filename = "/Users/work/" . $filename;
if (file_exists($filename)) {
unlink($filename);
} else {
//$fp = fopen($filename, 'a');
}
//$objWriter->save($filename);
$writer->save($filename);
return $filename;
}
/**
* 生成多sheet页 PHPExcel object用于输出
*
* @param 必填项 :data {要生成excel的三维数组,sheet页为第一维,array}
* @param 必填项 :keywords {生成excel文件使用的keywords数组(具体格式详见本类中keywords属性),array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return object {PHPExcel object}
*/
private static function getPHPExcelObjForMultiSheet($data)
{
set_time_limit(0);
// Create new PHPExcel object
$objPHPExcel = new Spreadsheet();
// Set document properties
$objPHPExcel->getProperties()
->setCreator("yidian")
->setLastModifiedBy("yidian")
->setTitle("标题")
->setSubject("题目")
->setDescription("描述")
->setKeywords("关键字")
->setCategory("种类");
$sheetIndex = 0;
foreach ($data as $sheet) {
$sheetName = !empty($sheet['sheetName']) ? $sheet['sheetName'] : 'sheet'.$sheetIndex;
$topHeader = !empty($sheet['topHeader']) ? $sheet['topHeader'] : '';
$keywords = !empty($sheet['keywords']) ? $sheet['keywords'] : '';
$items = !empty($sheet['items']) ? $sheet['items'] : '';
//创建一个新的工作空间(sheet)
($sheetIndex > 0) && $objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($sheetIndex);
$activeSheet = $objPHPExcel->getActiveSheet();
$activeSheet->setTitle($sheetName);
$index = 1;
$keywords = self::getKeywordsWithAlpha($keywords);
if ($topHeader) {
$indexAlpha = array_keys($keywords);
$endAlpha = end($indexAlpha);
$activeSheet->setCellValue('A1', $topHeader);
$activeSheet->mergeCells('A1:' . $endAlpha . '1');
$activeSheet->getRowDimension(1)->setRowHeight(30);
$activeSheet->getStyle('A1:' . $endAlpha . '1')
->getAlignment()
->setHorizontal('center')
->setVertical('center');
$index++;
}
foreach ($keywords as $key => $value) {
// set the wdith of cloumn
$activeSheet->getColumnDimension($key)->setWidth($value['column_width']);
// set the value of first row
$activeSheet->getStyle($key)
->getAlignment()
->setHorizontal('center');
$activeSheet->setCellValue($key . $index, $value['column_name']);
}
$index++;
if (empty($items) || !is_array($items)) {
continue;
}
foreach ($items as $item) {
foreach ($keywords as $key => $value) {
if (0 && is_numeric($item[$value['key']]) && ! is_int($item[$value['key']])) {
$activeSheet->setCellValue($key . $index, floatval($item[$value['key']]));
} elseif (0 && is_numeric($item[$value['key']])) {
$activeSheet->setCellValue($key . $index, intval($item[$value['key']]));
} else {
$activeSheet->setCellValue($key . $index, $item[$value['key']] . ' ');
}
$alignment = $activeSheet->getStyle($key . $index)->getAlignment();
// 换行
$alignment->setWrapText(true);
// 垂直居中
$alignment->setVertical('center');
}
$index ++;
}
$sheetIndex++;
}
return $objPHPExcel;
}
/**
* 将keywords数组索引转为excel英文列名
*
* @param 必填项 :keywords {keywords数组中下标,array}
* @return array {英文下标的数组(下标类似A,AA,BA)}
*/
private static function getKeywordsWithAlpha($keywords)
{
$keywordsWithAlpha = array();
if (is_array($keywords)) {
foreach ($keywords as $key => $value) {
$keywordsWithAlpha[self::intToUpperAlpha($key)] = $value;
}
}
return $keywordsWithAlpha;
}
/**
* 将数组int索引转化为excel列的列名字符串(A,AA,BA)
*
* @param 必填项 :ord {keywords数组中下标,int}
* @return string {excel列的列名字符串}
*/
private static function intToUpperAlpha($ord)
{
$baseOrd = ord('A');
$mod = floor($ord/26);
if ($mod == 0) {
$retAphla = chr($baseOrd + $ord);
} else {
$retAphla = chr($baseOrd + $mod-1);
$retAphla .= chr($baseOrd + $ord%26);
}
return $retAphla;
}
}
\ No newline at end of file
...@@ -70,7 +70,7 @@ class FileLog ...@@ -70,7 +70,7 @@ class FileLog
foreach ($mail_to as $mail) { foreach ($mail_to as $mail) {
$key = md5(sprintf("%s,%s", $mail, md5($signature))); $key = md5(sprintf("%s,%s", $mail, md5($signature)));
if (self::shouldSendEmail($key) === true) { if (self::shouldSendEmail($key) === true) {
Email::sendMail('noreply@yidian-inc.com', $mail, $subject, $body); Email::sendMail('bp-noreply@yidian-inc.com', $mail, $subject, $body);
} }
} }
} }
......
...@@ -175,7 +175,7 @@ abstract class MysqlBase ...@@ -175,7 +175,7 @@ abstract class MysqlBase
{ {
if(PHP_SAPI == 'cli'){ if(PHP_SAPI == 'cli'){
// cli模式下,不走单例,gone away // cli模式下,不走单例,gone away
$flush = true; //$flush = true;
} }
if (!isset(self::$dbConnect[static::CONFIG_INDEX.':'.$type]) || $flush) { if (!isset(self::$dbConnect[static::CONFIG_INDEX.':'.$type]) || $flush) {
self::$dbConnect[static::CONFIG_INDEX.':'.$type] = new Medoo(self::getDbConf($type)); self::$dbConnect[static::CONFIG_INDEX.':'.$type] = new Medoo(self::getDbConf($type));
......
...@@ -27,12 +27,12 @@ class InstalledVersions ...@@ -27,12 +27,12 @@ class InstalledVersions
private static $installed = array ( private static $installed = array (
'root' => 'root' =>
array ( array (
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-master',
'version' => 'dev-develop', 'version' => 'dev-master',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db', 'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
'name' => 'yidian/yaf_demo', 'name' => 'yidian/yaf_demo',
), ),
'versions' => 'versions' =>
...@@ -45,7 +45,7 @@ private static $installed = array ( ...@@ -45,7 +45,7 @@ private static $installed = array (
array ( array (
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => 'cc3be45aa9bfc968b35f1d60c43115dae5f80da3', 'reference' => '697463568a90156dd40ee8ff957c9cf189823c20',
), ),
'api/php_utils' => 'api/php_utils' =>
array ( array (
...@@ -55,7 +55,7 @@ private static $installed = array ( ...@@ -55,7 +55,7 @@ private static $installed = array (
array ( array (
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => '44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4', 'reference' => '04d22704930fc63806000f51914ce7bcd59d38ae',
), ),
'bacon/bacon-qr-code' => 'bacon/bacon-qr-code' =>
array ( array (
...@@ -238,7 +238,7 @@ private static $installed = array ( ...@@ -238,7 +238,7 @@ private static $installed = array (
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80', 'reference' => 'a603e5701bd6e305cfc777a8b50bf081ef73105e',
), ),
'symfony/polyfill-ctype' => 'symfony/polyfill-ctype' =>
array ( array (
...@@ -307,7 +307,7 @@ private static $installed = array ( ...@@ -307,7 +307,7 @@ private static $installed = array (
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'cb1aad06e7733a116f49033b1b3048a08e59ddd2', 'reference' => '12e1e517a315fa3a108dfcd3674e31542055d133',
), ),
'symfony/property-info' => 'symfony/property-info' =>
array ( array (
...@@ -316,7 +316,7 @@ private static $installed = array ( ...@@ -316,7 +316,7 @@ private static $installed = array (
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '36f5c26e3dbf6873b61b593cd86fe4616153d239', 'reference' => '63eddb6d10fffe3f25d901d78fef37ca88838b22',
), ),
'symfony/string' => 'symfony/string' =>
array ( array (
...@@ -329,12 +329,12 @@ private static $installed = array ( ...@@ -329,12 +329,12 @@ private static $installed = array (
), ),
'yidian/yaf_demo' => 'yidian/yaf_demo' =>
array ( array (
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-master',
'version' => 'dev-develop', 'version' => 'dev-master',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db', 'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
), ),
), ),
); );
......
...@@ -42,6 +42,7 @@ return array( ...@@ -42,6 +42,7 @@ return array(
'Api\\PhpUtils\\Cache\\CacheUtil' => $vendorDir . '/api/php_utils/src/Cache/CacheUtil.php', 'Api\\PhpUtils\\Cache\\CacheUtil' => $vendorDir . '/api/php_utils/src/Cache/CacheUtil.php',
'Api\\PhpUtils\\Common\\BaseConvert' => $vendorDir . '/api/php_utils/src/Common/BaseConvert.php', 'Api\\PhpUtils\\Common\\BaseConvert' => $vendorDir . '/api/php_utils/src/Common/BaseConvert.php',
'Api\\PhpUtils\\Common\\Docid' => $vendorDir . '/api/php_utils/src/Common/Docid.php', 'Api\\PhpUtils\\Common\\Docid' => $vendorDir . '/api/php_utils/src/Common/Docid.php',
'Api\\PhpUtils\\Common\\ExportExcel' => $vendorDir . '/api/php_utils/src/Common/ExportExcel.php',
'Api\\PhpUtils\\Common\\Geo' => $vendorDir . '/api/php_utils/src/Common/Geo.php', 'Api\\PhpUtils\\Common\\Geo' => $vendorDir . '/api/php_utils/src/Common/Geo.php',
'Api\\PhpUtils\\Common\\GoodsSkuId' => $vendorDir . '/api/php_utils/src/Common/GoodsSkuId.php', 'Api\\PhpUtils\\Common\\GoodsSkuId' => $vendorDir . '/api/php_utils/src/Common/GoodsSkuId.php',
'Api\\PhpUtils\\Common\\IP' => $vendorDir . '/api/php_utils/src/Common/IP.php', 'Api\\PhpUtils\\Common\\IP' => $vendorDir . '/api/php_utils/src/Common/IP.php',
...@@ -127,6 +128,7 @@ return array( ...@@ -127,6 +128,7 @@ return array(
'App\\Services\\marketing\\MarketingGoodsService' => $baseDir . '/application/services/marketing/MarketingGoodsService.php', 'App\\Services\\marketing\\MarketingGoodsService' => $baseDir . '/application/services/marketing/MarketingGoodsService.php',
'App\\Services\\marketing\\MarketingService' => $baseDir . '/application/services/marketing/MarketingService.php', 'App\\Services\\marketing\\MarketingService' => $baseDir . '/application/services/marketing/MarketingService.php',
'App\\Services\\shop\\ShopService' => $baseDir . '/application/services/shop/ShopService.php', 'App\\Services\\shop\\ShopService' => $baseDir . '/application/services/shop/ShopService.php',
'App\\Services\\tcc\\Tcc2Service' => $baseDir . '/application/services/tcc/Tcc2Service.php',
'App\\Services\\tcc\\TccService' => $baseDir . '/application/services/tcc/TccService.php', 'App\\Services\\tcc\\TccService' => $baseDir . '/application/services/tcc/TccService.php',
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'BaconQrCode\\Common\\BitArray' => $vendorDir . '/bacon/bacon-qr-code/src/Common/BitArray.php', 'BaconQrCode\\Common\\BitArray' => $vendorDir . '/bacon/bacon-qr-code/src/Common/BitArray.php',
......
...@@ -271,6 +271,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2 ...@@ -271,6 +271,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'Api\\PhpUtils\\Cache\\CacheUtil' => __DIR__ . '/..' . '/api/php_utils/src/Cache/CacheUtil.php', 'Api\\PhpUtils\\Cache\\CacheUtil' => __DIR__ . '/..' . '/api/php_utils/src/Cache/CacheUtil.php',
'Api\\PhpUtils\\Common\\BaseConvert' => __DIR__ . '/..' . '/api/php_utils/src/Common/BaseConvert.php', 'Api\\PhpUtils\\Common\\BaseConvert' => __DIR__ . '/..' . '/api/php_utils/src/Common/BaseConvert.php',
'Api\\PhpUtils\\Common\\Docid' => __DIR__ . '/..' . '/api/php_utils/src/Common/Docid.php', 'Api\\PhpUtils\\Common\\Docid' => __DIR__ . '/..' . '/api/php_utils/src/Common/Docid.php',
'Api\\PhpUtils\\Common\\ExportExcel' => __DIR__ . '/..' . '/api/php_utils/src/Common/ExportExcel.php',
'Api\\PhpUtils\\Common\\Geo' => __DIR__ . '/..' . '/api/php_utils/src/Common/Geo.php', 'Api\\PhpUtils\\Common\\Geo' => __DIR__ . '/..' . '/api/php_utils/src/Common/Geo.php',
'Api\\PhpUtils\\Common\\GoodsSkuId' => __DIR__ . '/..' . '/api/php_utils/src/Common/GoodsSkuId.php', 'Api\\PhpUtils\\Common\\GoodsSkuId' => __DIR__ . '/..' . '/api/php_utils/src/Common/GoodsSkuId.php',
'Api\\PhpUtils\\Common\\IP' => __DIR__ . '/..' . '/api/php_utils/src/Common/IP.php', 'Api\\PhpUtils\\Common\\IP' => __DIR__ . '/..' . '/api/php_utils/src/Common/IP.php',
...@@ -356,6 +357,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2 ...@@ -356,6 +357,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'App\\Services\\marketing\\MarketingGoodsService' => __DIR__ . '/../..' . '/application/services/marketing/MarketingGoodsService.php', 'App\\Services\\marketing\\MarketingGoodsService' => __DIR__ . '/../..' . '/application/services/marketing/MarketingGoodsService.php',
'App\\Services\\marketing\\MarketingService' => __DIR__ . '/../..' . '/application/services/marketing/MarketingService.php', 'App\\Services\\marketing\\MarketingService' => __DIR__ . '/../..' . '/application/services/marketing/MarketingService.php',
'App\\Services\\shop\\ShopService' => __DIR__ . '/../..' . '/application/services/shop/ShopService.php', 'App\\Services\\shop\\ShopService' => __DIR__ . '/../..' . '/application/services/shop/ShopService.php',
'App\\Services\\tcc\\Tcc2Service' => __DIR__ . '/../..' . '/application/services/tcc/Tcc2Service.php',
'App\\Services\\tcc\\TccService' => __DIR__ . '/../..' . '/application/services/tcc/TccService.php', 'App\\Services\\tcc\\TccService' => __DIR__ . '/../..' . '/application/services/tcc/TccService.php',
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'BaconQrCode\\Common\\BitArray' => __DIR__ . '/..' . '/bacon/bacon-qr-code/src/Common/BitArray.php', 'BaconQrCode\\Common\\BitArray' => __DIR__ . '/..' . '/bacon/bacon-qr-code/src/Common/BitArray.php',
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git", "url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "cc3be45aa9bfc968b35f1d60c43115dae5f80da3" "reference": "697463568a90156dd40ee8ff957c9cf189823c20"
}, },
"require": { "require": {
"api/php_utils": "dev-master", "api/php_utils": "dev-master",
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"perftools/php-profiler": "^0.18.0", "perftools/php-profiler": "^0.18.0",
"php": "7.2.*" "php": "7.2.*"
}, },
"time": "2021-07-19T12:51:28+00:00", "time": "2021-07-26T03:47:20+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"installation-source": "source", "installation-source": "source",
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git", "url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4" "reference": "04d22704930fc63806000f51914ce7bcd59d38ae"
}, },
"require": { "require": {
"elasticsearch/elasticsearch": "~7.0", "elasticsearch/elasticsearch": "~7.0",
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"mongodb/mongodb": "1.4.3", "mongodb/mongodb": "1.4.3",
"php": "7.2.*" "php": "7.2.*"
}, },
"time": "2021-07-19T16:13:22+00:00", "time": "2021-07-26T01:42:18+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"installation-source": "source", "installation-source": "source",
...@@ -1189,21 +1189,21 @@ ...@@ -1189,21 +1189,21 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "05b35d6cc6227dc22fc053d0cfcd9f41000e2c80" "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/05b35d6cc6227dc22fc053d0cfcd9f41000e2c80", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e",
"reference": "05b35d6cc6227dc22fc053d0cfcd9f41000e2c80", "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1", "symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php73": "~1.0", "symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.15" "symfony/polyfill-php80": "^1.16"
}, },
"time": "2021-07-02T16:38:59+00:00", "time": "2021-07-23T15:55:36+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
...@@ -1236,7 +1236,7 @@ ...@@ -1236,7 +1236,7 @@
"options" "options"
], ],
"support": { "support": {
"source": "https://github.com/symfony/options-resolver/tree/5.3" "source": "https://github.com/symfony/options-resolver/tree/5.4"
}, },
"funding": [ "funding": [
{ {
...@@ -1771,18 +1771,18 @@ ...@@ -1771,18 +1771,18 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/property-access.git", "url": "https://github.com/symfony/property-access.git",
"reference": "cb1aad06e7733a116f49033b1b3048a08e59ddd2" "reference": "12e1e517a315fa3a108dfcd3674e31542055d133"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/cb1aad06e7733a116f49033b1b3048a08e59ddd2", "url": "https://api.github.com/repos/symfony/property-access/zipball/12e1e517a315fa3a108dfcd3674e31542055d133",
"reference": "cb1aad06e7733a116f49033b1b3048a08e59ddd2", "reference": "12e1e517a315fa3a108dfcd3674e31542055d133",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1", "symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15", "symfony/polyfill-php80": "^1.16",
"symfony/property-info": "^5.2|^6.0" "symfony/property-info": "^5.2|^6.0"
}, },
"require-dev": { "require-dev": {
...@@ -1791,7 +1791,7 @@ ...@@ -1791,7 +1791,7 @@
"suggest": { "suggest": {
"psr/cache-implementation": "To cache access methods." "psr/cache-implementation": "To cache access methods."
}, },
"time": "2021-07-17T18:34:10+00:00", "time": "2021-07-21T12:43:48+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
...@@ -1855,18 +1855,18 @@ ...@@ -1855,18 +1855,18 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/property-info.git", "url": "https://github.com/symfony/property-info.git",
"reference": "36f5c26e3dbf6873b61b593cd86fe4616153d239" "reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/36f5c26e3dbf6873b61b593cd86fe4616153d239", "url": "https://api.github.com/repos/symfony/property-info/zipball/63eddb6d10fffe3f25d901d78fef37ca88838b22",
"reference": "36f5c26e3dbf6873b61b593cd86fe4616153d239", "reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1", "symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15", "symfony/polyfill-php80": "^1.16",
"symfony/string": "^5.1|^6.0" "symfony/string": "^5.1|^6.0"
}, },
"conflict": { "conflict": {
...@@ -1887,7 +1887,7 @@ ...@@ -1887,7 +1887,7 @@
"symfony/doctrine-bridge": "To use Doctrine metadata", "symfony/doctrine-bridge": "To use Doctrine metadata",
"symfony/serializer": "To use Serializer metadata" "symfony/serializer": "To use Serializer metadata"
}, },
"time": "2021-07-18T16:31:21+00:00", "time": "2021-07-21T12:43:48+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
......
<?php return array ( <?php return array (
'root' => 'root' =>
array ( array (
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-master',
'version' => 'dev-develop', 'version' => 'dev-master',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db', 'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
'name' => 'yidian/yaf_demo', 'name' => 'yidian/yaf_demo',
), ),
'versions' => 'versions' =>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
array ( array (
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => 'cc3be45aa9bfc968b35f1d60c43115dae5f80da3', 'reference' => '697463568a90156dd40ee8ff957c9cf189823c20',
), ),
'api/php_utils' => 'api/php_utils' =>
array ( array (
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
array ( array (
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => '44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4', 'reference' => '04d22704930fc63806000f51914ce7bcd59d38ae',
), ),
'bacon/bacon-qr-code' => 'bacon/bacon-qr-code' =>
array ( array (
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80', 'reference' => 'a603e5701bd6e305cfc777a8b50bf081ef73105e',
), ),
'symfony/polyfill-ctype' => 'symfony/polyfill-ctype' =>
array ( array (
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'cb1aad06e7733a116f49033b1b3048a08e59ddd2', 'reference' => '12e1e517a315fa3a108dfcd3674e31542055d133',
), ),
'symfony/property-info' => 'symfony/property-info' =>
array ( array (
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '36f5c26e3dbf6873b61b593cd86fe4616153d239', 'reference' => '63eddb6d10fffe3f25d901d78fef37ca88838b22',
), ),
'symfony/string' => 'symfony/string' =>
array ( array (
...@@ -303,12 +303,12 @@ ...@@ -303,12 +303,12 @@
), ),
'yidian/yaf_demo' => 'yidian/yaf_demo' =>
array ( array (
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-master',
'version' => 'dev-develop', 'version' => 'dev-master',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db', 'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
), ),
), ),
); );
...@@ -1049,7 +1049,7 @@ class OptionsResolver implements Options ...@@ -1049,7 +1049,7 @@ class OptionsResolver implements Options
$fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]); $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]);
$fmtProvidedTypes = implode('|', array_keys($invalidTypes)); $fmtProvidedTypes = implode('|', array_keys($invalidTypes));
$allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) { $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) {
return '[]' === substr($item, -2); return str_ends_with($item, '[]');
})) > 0; })) > 0;
if (\is_array($value) && $allowedContainsArrayType) { if (\is_array($value) && $allowedContainsArrayType) {
...@@ -1211,6 +1211,8 @@ class OptionsResolver implements Options ...@@ -1211,6 +1211,8 @@ class OptionsResolver implements Options
/** /**
* Not supported. * Not supported.
* *
* @return void
*
* @throws AccessException * @throws AccessException
*/ */
public function offsetSet($option, $value) public function offsetSet($option, $value)
...@@ -1221,6 +1223,8 @@ class OptionsResolver implements Options ...@@ -1221,6 +1223,8 @@ class OptionsResolver implements Options
/** /**
* Not supported. * Not supported.
* *
* @return void
*
* @throws AccessException * @throws AccessException
*/ */
public function offsetUnset($option) public function offsetUnset($option)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1", "symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php73": "~1.0", "symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.15" "symfony/polyfill-php80": "^1.16"
}, },
"autoload": { "autoload": {
"psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },
......
...@@ -249,7 +249,7 @@ class PropertyAccessor implements PropertyAccessorInterface ...@@ -249,7 +249,7 @@ class PropertyAccessor implements PropertyAccessorInterface
} }
if (\PHP_VERSION_ID < 80000) { if (\PHP_VERSION_ID < 80000) {
if (0 !== strpos($message, 'Argument ')) { if (!str_starts_with($message, 'Argument ')) {
return; return;
} }
...@@ -466,7 +466,7 @@ class PropertyAccessor implements PropertyAccessorInterface ...@@ -466,7 +466,7 @@ class PropertyAccessor implements PropertyAccessorInterface
&& $object instanceof $trace['class'] && $object instanceof $trace['class']
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches) && preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)
) { ) {
throw new UninitializedPropertyException(sprintf('The method "%s::%s()" returned "null", but expected type "%3$s". Did you forget to initialize a property or to make the return type nullable using "?%3$s"?', false === strpos(\get_class($object), "@anonymous\0") ? \get_class($object) : (get_parent_class($object) ?: key(class_implements($object)) ?: 'class').'@anonymous', $name, $matches[1]), 0, $e); throw new UninitializedPropertyException(sprintf('The method "%s::%s()" returned "null", but expected type "%3$s". Did you forget to initialize a property or to make the return type nullable using "?%3$s"?', !str_contains(\get_class($object), "@anonymous\0") ? \get_class($object) : (get_parent_class($object) ?: key(class_implements($object)) ?: 'class').'@anonymous', $name, $matches[1]), 0, $e);
} }
throw $e; throw $e;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1", "symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15", "symfony/polyfill-php80": "^1.16",
"symfony/property-info": "^5.2|^6.0" "symfony/property-info": "^5.2|^6.0"
}, },
"require-dev": { "require-dev": {
......
...@@ -109,14 +109,14 @@ final class PhpDocTypeHelper ...@@ -109,14 +109,14 @@ final class PhpDocTypeHelper
return null; return null;
} }
if ('[]' === substr($docType, -2)) { if (str_ends_with($docType, '[]')) {
$collectionKeyType = new Type(Type::BUILTIN_TYPE_INT); $collectionKeyType = new Type(Type::BUILTIN_TYPE_INT);
$collectionValueType = $this->createType($type, false, substr($docType, 0, -2)); $collectionValueType = $this->createType($type, false, substr($docType, 0, -2));
return new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, $collectionKeyType, $collectionValueType); return new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, $collectionKeyType, $collectionValueType);
} }
if (0 === strpos($docType, 'array<') && $type instanceof Array_) { if (str_starts_with($docType, 'array<') && $type instanceof Array_) {
// array<value> is converted to x[] which is handled above // array<value> is converted to x[] which is handled above
// so it's only necessary to handle array<key, value> here // so it's only necessary to handle array<key, value> here
$collectionKeyType = $this->getTypes($type->getKeyType())[0]; $collectionKeyType = $this->getTypes($type->getKeyType())[0];
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1", "symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15", "symfony/polyfill-php80": "^1.16",
"symfony/string": "^5.1|^6.0" "symfony/string": "^5.1|^6.0"
}, },
"require-dev": { "require-dev": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment